﻿using OpenHttpServer.Models;

namespace OpenHttpServer
{
    public class HttpBuilder
    {
        public static HttpResponse InternalServerError()
        {
            string content = "500 InternalServerError";

            return new HttpResponse()
            {
                ReasonPhrase = "InternalServerError",
                StatusCode = 500,
                ContentAsUTF8 = content
            };
        }

        public static HttpResponse NotFound()
        {
            string content = "404 NotFound";

            return new HttpResponse()
            {
                ReasonPhrase = "NotFound",
                StatusCode = 404,
                ContentAsUTF8 = content
            };
        }

        public static HttpResponse Forbidden()
        {
            string content = "403 Forbidden";

            return new HttpResponse()
            {
                ReasonPhrase = "Forbidden",
                StatusCode = 403,
                ContentAsUTF8 = content
            };
        }
        public static HttpResponse NotSupported()
        {
            string content = "501 Not Implemented";

            return new HttpResponse()
            {
                ReasonPhrase = "Not Implemented",
                StatusCode = 501,
                ContentAsUTF8 = content
            };

        }
        public static HttpResponse Unauthorized()
        {
            string content = "401 Unauthorized";

            return new HttpResponse()
            {
                ReasonPhrase = "Unauthorized",
                StatusCode = 401,
                ContentAsUTF8 = content
            };

        }
    }
}
